function formatNumber(value:any){
  if(!value) return
  return `${value}`.replace(/(\d{3})(?=\d)/g,'$1,')
}

export default function useFormat(){
  const numberFormat = (value:any)=> formatNumber(value)
  const moneyFormat = (money:any)=>`￥${formatNumber(money)}`

  return{
    numberFormat,
    moneyFormat
  }
}